<html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
		<meta charset="utf-8">
		<link rel="stylesheet" href="css/demo01.css">
		<script type="text/javascript" src="js/demo09.js"></script>
		<style>
			.delImg{
				width:24px;
				height:24px;
			}
		</style>
	</head>
	<body>
		<div id="div_container">
			<div id="div_fruit_list">
				<table id="tbl_fruit">
					<tr>
						<th class="w20">名称</th>
						<th class="w20">单价</th>
						<th class="w20">数量</th>
						<th class="w20">小计</th>
						<th>操作</th>
					</tr>
					<tr>
						<td>苹果</td>
						<td>5</td>
						<td>20</td>
						<td>100</td>
						<td><img src="imgs/del.jpg" class="delImg"/></td>
					</tr>
					<tr>	
						<td>西瓜</td>
						<td>3</td>
						<td>20</td>
						<td>60</td>
						<td><img src="imgs/del.jpg" class="delImg"/></td>
					</tr>
					<tr>
						<td>菠萝</td>
						<td>4</td>
						<td>25</td>
						<td>100</td>
						<td><img src="imgs/del.jpg" class="delImg"/></td>
					</tr>
					<tr>
						<td>榴莲</td>
						<td>3</td>
						<td>30</td>
						<td>90</td>
						<td><img src="imgs/del.jpg" class="delImg"/></td>
					</tr>
					<tr>
						<td>总计</td>
						<td colspan="4">999</td>
					</tr>
				</table>
				<hr/>
				<div id="add_fruit_div">
					<form action="http://localhost:8080/fruit9/fruit.do" method="POST">
						<input type="hidden" name="operation" value="add">
						<table>
							<tr>
								<td>名称：</td>
								<td><input type='text' id='fname' name="fname" value="" class="fname"/></td>
							</tr>
							<tr>
								<td>单价：</td>
								<td><input type='text' id='price' name="price" value=""/></td>
							</tr>
							<tr>
								<td>数量：</td>
								<td><input type='text' id='fcount' name="fcount" value=""/></td>
							</tr>
							<tr>
								<th colspan="2">
									<div class="add"><input type='submit' value="添加"/></div>
									<div class="btn"><input type='button' value="重填"/></div>
								</th>
							</tr>
						</table>
					</form>
				</div>
			</div>
		</div>
		<script>
			document.querySelector('.btn').addEventListener('click',() => {
				fname = ''
				 price= ''
				fcount = ''
			})
		</script>
	</body>
</html>
